package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"os/exec"
)

func main()  {
	//cmd := exec.Command("sh", "-c", "ls")
	//data, _ := cmd.Output()
	//fmt.Print([]byte(data))
	for {

		var inputReader *bufio.Reader
		inputReader = bufio.NewReader(os.Stdin)
		sanData, err := inputReader.ReadString('\n')
		data := []byte(sanData)
		data = data[:len(data)-1]

		cmd := exec.Command("sh", "-c", string(data))
		var resData []byte = make([]byte, 1024)
		resData, err = cmd.Output();
		if err != nil {
			fmt.Println(err)
			//os.Exit(1)
		}
		log.Println(string(resData))
	}
}
